<?php

declare(strict_types=1);

namespace App\Command;
use Hyperf\Command\Command as HyperfCommand;
use Hyperf\Command\Annotation\Command;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Input\InputArgument;
/**
 * @Command
 */
class FooCommand extends HyperfCommand{
    protected $name = 'foo:hello';

    public function configure(){
        parent::configure();
        $this->setDescription('Hyperf Demo Command');
    }

    public function handle(){
        $argument = $this->input->getArgument('name') ?? 'World';
        $this->line('Hello '.$argument, 'info');
    }

    protected function getArguments(){
        return [
            ['name', InputArgument::OPTIONAL, '这里是对这个参数的解释']
        ];
    }
}
